1. Field of the Invention
The present invention relates to a sound encoder that outputs a sound code produced by compressing a digital sound signal associated with a sound, such as a musical sound or a voice, into a small volume of information, and a sound decoder that decodes the sound code so as to reproduce the sound signal. Particularly, it relates to a sound encoder for, when transmitting a sound code by way of a route onto which bit errors can be piggybacked, multiplexing codes into the sound code so that it contains an error correction code in order to reduce the degree of influence of bit errors, and a sound decoder that pairs up with the sound encoder.
2. Description of Related Art
Most prior art sound encoders produce a plurality of codes having a small volume of information from a sound signal, multiplex them, and produce a sound code which is a combination of the multiplexed codes and an error correction code which is obtained by defining part or all of the multiplexed codes as a target region to be protected. Prior art sound decoders decode the sound code except the error correction code so as to reproduce the sound signal after making an error correction to the target region to be protected by using the error correction code included in the sound code.
FIG. 13 shows the structure of a prior art sound encoder. In the figure, reference numeral 1 denotes a sound signal which is input as a target to be coded to the sound encoder, reference numeral 2 denotes an encoding unit for encoding the sound signal 1 into a plurality of codes and for outputting them, reference numeral 7 denotes an LSP code, reference numeral 8 denotes an adaptive sound source code, reference numeral 9 denotes a driving sound source code, and reference numeral 10 denotes a gain code. The sound signal 1 is encoded into the plurality of codes by the encoding unit 2. Reference numeral 51 denotes a multiplexing unit for multiplexing the plurality of codes produced by the encoding unit 2, reference numeral 12 denotes a multiplexed code into which those codes are multiplexed by the multiplexing unit 51, and reference numeral 5 denotes an error correction coding unit for acquiring an error correction code to be added to the multiplexed code 12, and for outputting a sound code 6.
FIG. 14 shows the structure of a prior art sound decoder. In the figure, reference numeral 6 denotes a sound code, reference numeral 13 denotes an error correction decoding unit for making an error correction to the sound code 6 using an error correction code included in the sound code and for outputting the error-corrected sound code except the error correction code as a multiplexed code 18, reference numeral 52 denotes a demultiplexing unit for demultiplexing the multiplexed code 18 into a plurality of codes, reference numeral 21 denotes an LSP code, reference numeral 22 denotes an adaptive sound source code, reference numeral 23 denotes a driving sound source code, and reference numeral 19 denotes a gain code. The input sound code 6 is demultiplexed into those codes by the demultiplexing unit 52. Reference numeral 16 denotes a decoding unit for decoding the plurality of codes so as to reproduce a sound signal 17.
Hereafter, the operations of the prior art sound encoder and sound decoders will be explained. In the prior art sound encoder, the encoding processing is performed on a frame-by-frame basis, by assuming that each frame of the input sound signal has a predetermined length of, for example, 10 ms. First of all, the sound signal 1 is input to the encoding unit 2. The encoding unit 2 performs a linear prediction analysis on the input sound signal 1 to produce linear prediction coefficients and then converts this linear prediction coefficient into LSP (Line Spectral Pairs) so as to output an LSP code 7 produced by encoding the LSP. The encoding unit 2 produces an adaptive sound source code 8 by encoding an adaptive sound source which corresponds to a pitch-scaled periodic component of a sound source, produces a driving sound source code 9 by encoding a driving sound source which corresponds to a remaining component which is the remainder of the sound source other than the adaptive sound source component, and produces a gain code 10 by encoding gains which provide respective amplitudes for the adaptive sound source and the driving sound source, and then outputs those codes to the multiplexing unit 51.
The multiplexing unit 51 multiplexes the LSP code 7, the adaptive sound source code 8, the driving sound source code 9, and the gain code 10 into a multiplexed code 12 in a predetermined order, and outputs the acquired multiplexed code 12. The error correction coding unit 5 defines a predetermined region included in the multiplexed code 12 as a target region to be protected and produces an error correction code associated with this target region to be protected, and adds the produced error correction code to the end of the multiplexed code, and outputs the acquired code as a sound code 6. A convolutional code, a CRC code, or the like can be used as the error correction code.
The error correction decoding unit 13 demultiplexes the sound code 6 into a multiplexed code and an error correction code by defining a predetermined position of the sound code 6 as a boundary of them, so that part of the sound code 6 prior to the predetermined position is the multiplexed code and the remainder of the sound code 6 posterior to the predetermined position is the error correction code. The error correction decoding unit 13 then makes an error correction using the error correction code by defining a predetermined region included in the multiplexed code as a target region to be protected, and outputs the error-corrected multiplexed code 18. The demultiplexing unit 52 demultiplexes the multiplexed code 18 into an LSP code 21, an adaptive sound source code 22, a driving sound source code 23, and a gain code 19 in the order which has been determined in advance, and outputs the LSP code 21, the adaptive sound source code 22, the driving sound source code 23, and the gain code 19.
The decoding unit 16 decodes the adaptive sound source code 22 so as to produce the adaptive sound source, decodes the driving sound source code 23 so as to produce the driving sound source, decodes the gain code 19 so as to produce the respective gains for the adaptive sound source and the driving sound source, and produces the sound source by multiplying the adaptive sound source and the driving sound source by the respective gains and summing them multiplied by the respective gains. The decoding unit 16 then acquires the LSP by decoding the LSP code 21, converts this LSP into a linear prediction coefficient, and delivers the sound source to a synthesis filter in which the linear prediction coefficient is set as a filter coefficient so as to reproduce a sound signal 17. The decoding unit 16 outputs this sound signal 17.
FIG. 15 is a diagram showing the structure of each of the multiplexed code 12 handled by the prior art sound encoder, and the multiplexed code 18 handled by the prior art sound decoder. Codes, such as an LSP code, an adaptive sound source code, a driving sound source code, and a gain code, which are acquired from a sound signal, have different bit error sensibilities, and bits included in each code have different bit error sensibilities according to their bit positions. The bit error sensibility of each bit is an index for indicating how much the decoded sound signal deteriorates when a bit error occurs in each bit. The error correction encoding unit can effectively make an error correction by using an error correction code having a predetermined number of bits by defining only codes with a high bit sensibility or bits with a high bit sensibility in a specific code as a target region to be protected when performing error correction encoding.
In the case of FIG. 15, all of the gain code 10, a part of the LSP code 7 and a part of the adaptive sound source code 8 having high bit error sensibilities are multiplexed into a first half of the multiplexed code as a target region to be protected. The remainder of the LSP code 7, the remainder of the adaptive sound source code 8 and all of the driving sound source code 9 are placed outside the target region to be protected in the multiplexed code. Because this multiplexing order is determined based on average bit error sensitivities or the like when the multiplexing unit 51 is designed, the multiplexing order does not vary frame to frame and is fixed. In addition, the target region to be protected is also fixed.
Some prior art sound encoders and sound decoders in which multiplexing and the target region to be protected vary from frame to frame adopt a multimode coding method. A prior art sound encoder which adopts a multimode encoding method has two or more types of encoding units, and selects and uses one encoding unit according to results of analysis on the sound signal consisting of target frames to be coded and the state of a transmission path. The prior art sound encoder is provided with a plurality of multiplexing units which pair with the plurality of encoding units, respectively, because the plurality of encoding units output a plurality of codes having different configurations, respectively. The prior art sound encoder thus performs multiplexing by using a corresponding multiplexing unit that pairs with the selected encoding unit, and also multiplexes a mode code indicating which encoding unit has been selected.
A corresponding prior art sound decoder which also adopts the multimode encoding method is provided with a plurality of demultiplexing units and a plurality of decoding units, and uses one demultiplexing unit and one decoding unit specified by the mode code demultiplexed first. Thus, the prior art sound encoder, which adopts the multimode encoding method, further includes one or more encoding units and one or more multiplexing units in addition to the structure shown in FIG. 13, and the prior art sound decoder, which adopts the multimode encoding method, further includes one or more demultiplexing units and one or more decoding units in addition to the structure shown in FIG. 14. In the sound encoder, the order in which a plurality of codes output from an encoding unit are multiplexed and the target region to be protected do not vary from frame to frame and are fixed.
“3rd Generation Partnership Project; Technical Specification Group GERAN; Channel coding (Release 1999)”, 3 GPP TS05.03 V8.6.1 (2001-01) discloses another prior art sound encoder and another prior art sound decoder which adopt a multimode encoding method. The prior art sound encoder disclosed in the document has a plurality of encoding units. Each of the plurality of encoding units includes all of the sound encoder as shown in FIG. 13, and the encoding means in each encoding unit provides a bit rate different from that provided by the encoding means of any other encoding unit. Which encoding unit is used is specified by something placed outside the sound encoder. Similarly, the prior art sound decoder disclosed in the above document is provided with a plurality of decoding units. Each of the plurality of decoding units includes all of the sound decoder as shown in FIG. 14, and the decoding means in each decoding unit provides a bit rate different from that provided by the decoding means of any other decoding unit. Which decoding unit is used is specified by something placed outside the sound decoder. In the prior art sound encoder and the prior art sound decoder, the order in which a plurality of codes output from an encoding unit are multiplexed and the target region to be protected do not vary from frame to frame and are fixed.
Japanese patent application publications No. 9-106299 and No. 2000-183751 disclose other prior art sound encoders and other prior art sound decoders. In a prior art sound encoder and a prior art sound decoder disclosed in Japanese patent application publication No. 9-106299, to select only a necessary one from among all samples of the frequency domain coefficient into which the sound signal is converted and to encode the selected sample with a high degree of efficiency, an encoding unit encodes only a predetermined number of partial correlation coefficients which are selected in decreasing order of coefficient value (amplitude). The encoding unit encodes the predetermined number of partial correlation coefficients in decreasing order of coefficient value, and, when encoding a partial correlation coefficient for a second or later time, decodes the immediately-coded partial correlation coefficient, normalizes the next partial correlation coefficient to be coded with the decoded value, and encodes the normalized correlation coefficient. After the sample numbers are converted into binary numbers and the series of sample numbers is Huffman-coded, information on the order in which the plurality of partial correlation coefficients are to be encoded is delivered from the sound encoder to the sound decoder. The prior art sound encoder can have the same structure as shown in FIG. 13 with the exception that the internal structure of the encoding unit 2 is modified, and the prior art sound decoder can have the same structure as shown in FIG. 14 with the exception that the internal structure of the decoding unit 16 is modified.
In a prior art sound encoder and a prior art sound decoder disclosed in Japanese patent application publication No. 2000-183751, to implement variable bit rate encoding synchronized with a traffic (congestions in a transmission path) in real time, bits of data to be coded, bit sensibilities based on data errors, and so on are sorted according to a predetermined standard, under the assumption that agreement about the order in which bits of data to be coded and so on are sorted is made in advance between the encoding side and the decoding side. In other words, the order in which bits of data to be coded and so on are sorted does not vary from frame to frame and is fixed.
A problem with the prior art sound encoder and the prior art sound decoder as shown in FIGS. 13 and 14 is that it is impossible to implement the error protection which reflects a distribution of bit error sensibilities that varies from frame to frame because the order in which a plurality of codes is to be multiplexed into a single code and the target region to be protected do not vary from frame to frame and are fixed, and therefore deterioration in the sound signal due to occurrence of bit errors cannot be sufficiently prevented. Similarly, prior art sound encoders and prior art sound decoders as disclosed in “3rd Generation Partnership Project; Technical Specification Group GERAN; Channel coding (Release 1999)”, 3 GPP TS05.03 V8.6.1 (2001-01), in which multimode encoding is adopted, has the same problem because the order output from an encoding unit, in which a plurality of codes is to be multiplexed into a single code, and the target region to be protected do not vary from frame to frame and are fixed.
The prior art sound encoder and the prior art sound decoder disclosed in Japanese patent application publication No. 9-106299, do not sufficiently prevent deterioration in the sound signal due to occurrence of bit errors by adding an error correction code to a single code into which a plurality of codes are multiplexed, but only modify the encoding unit. If anything, deterioration in the sound signal due to the occurrence of bit errors increases because of addition of a code associated with the order in which partial correlation coefficients are to be multiplexed and encoding of a partial correlation coefficient for a second or later time after decoding the immediately-coded partial correlation coefficient and normalizing the next partial correlation coefficient to be coded with the decoded value.
A problem with prior art sound encoder and prior art sound decoders as disclosed in Japanese patent application publication No. 2000-183751 is that it is impossible to implement the error protection which reflects a distribution of bit error sensibilities that varies from frame to frame because the order in which bits of data to be coded and so on are sorted does not vary from frame to frame and is fixed, and therefore deterioration in the sound signal due to occurrence of bit errors cannot be sufficiently prevented.